package org.idea.spring.aop.version1.aspect;

import org.idea.spring.aop.version1.annotation.After;
import org.idea.spring.aop.version1.annotation.Aspect;
import org.idea.spring.aop.version1.annotation.Before;
import org.idea.spring.aop.version1.annotation.Pointcut;

import java.lang.reflect.Method;

/**
 * 切面
 *
 * @Author linhao
 * @Date created in 3:43 下午 2021/5/6
 */
@Aspect
public class MyAspect {

    @Pointcut("org.idea.spring.aop.version1.test.*.*(..)")
    public void pointCut(){
    }

    @Before("pointCut()")
    public void doBefore(Method method, Object object){
        System.out.println("doBefore");
    }

    @After("pointCut()")
    public void doAfter(Method method, Object object){
        System.out.println("doAfter");
    }
}
